#include<stdio.h>

int main(void)
{
	//验证大小端   指针	
	int n = 0x12345678;
	char *p = (char *)&n;
	*p == 0x78 ? printf("小端\n") : printf("大端\n");

	//验证大小端  共用体
	union endion{
		int n;
		int c;
	};

	union endion a;
	a.n = 0x12345678;
	a.c == 0x12 ? printf("大端\n") : printf("小端\n");
	return 0;
}
